package com.cqw;

import com.cqw.annotation.EnableLog;
import com.cqw.annotation.EnableRepeatSubmit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;
import springfox.documentation.oas.annotations.EnableOpenApi;

@SpringBootApplication
@EnableOpenApi
@EnableLog  //开启日志
@EnableScheduling    //开启定时任务
@EnableRepeatSubmit     //开启幂等性
@EnableTransactionManagement    //开启事务管理器
//@EnableAuthorizationServer  //开启授权服务器
//@EnableResourceServer //开启资源服务器，下面所有的接口访问都需要带token
@EnableGlobalMethodSecurity(prePostEnabled = true)  //开启方法级别的权限验证
public class CommonToolApplication {

    public static void main(String[] args) {
        SpringApplication.run(CommonToolApplication.class, args);
        System.out.println("(♥◠‿◠)ﾉﾞ  启动成功   ლ(´ڡ`ლ)ﾞ  \n" +
                "   ******      **       *******  \n" +
                "  **////**    ****     **/////** \n" +
                " **    //    **//**   **     //**\n" +
                "/**         **  //** /**      /**\n" +
                "/**        **********/**      /**\n" +
                "//**    **/**//////**//**     ** \n" +
                " //****** /**     /** //*******");
    }


    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

}
